package com.findyou.path;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Title: PathController
 * @Author 贾金博
 * @Package com.findyou.path
 * @Date 2024/3/3 15:51
 * @description:
 */

@RestController
@RequestMapping("path")
public class PathController {

    /**
     * 动态路径的传参
     * @PathVariable 路径参数的接收 这个注解是必须的
     * @return
     */
    @RequestMapping("/login/{account}/{password}")
    // path/账号/密码
    public String login(@PathVariable("account") String username, @PathVariable String password) {
        System.out.println("username = " + username + ", password = " + password);
        return "username = " + username + ", password = " + password;
    }
}
